﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace Fcdbas.WinUI.Controls
{
    [ToolboxBitmap(typeof(Label))]
    [ToolboxItemFilter("System.Windows.Forms")]
    public class cLabel : LabelControl
    {
        public string DataItem { get; set; }
        public cLabel()
        {
            this.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
        }
        private bool isNullValue;
        /// <summary>
        /// 值是否能为空
        /// </summary>
        [Description("值是否能为空")]
        [Category("Appearance")]
        [DefaultValue(false)]
        public bool IsNullValue
        {
            get
            {
                return isNullValue;
            }
            set
            {
                isNullValue = value;
                if (isNullValue)
                {
                    this.Font = new System.Drawing.Font("Arial", 10.5F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    this.ForeColor = System.Drawing.SystemColors.Highlight;
                }
                else
                {
                    this.Font = new System.Drawing.Font("Arial", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
                    this.ForeColor = Color.FromArgb(32, 31, 53);
                }

            }
        }
    }
}
